This demo program shows how to display any QuickTime content within a java.awt display space using the QTCanvas. It also demonstrates the use of the different resize options of the QTCanvas (with the QTCanvas' alignment set to centre it in the display space).
The duke animation at the top of the window is from the Duke animation sample applet.
The user selects any QuickTime media - the file is displayed using the QTFactory.makeDrawable method. The user can apply the various resize options of the QTCanvas. The x and y alignment values of the QTCanvas are programmtically set at 0.5F - which centres the QTCanvas within the area that Java's layout managers allocate to the QTCanvas. The actual control of the canvas' size can be seen by setting the resize options to 'allow any size'.
A QTSession.open will perform a gestalt check to ensure that QuickTime is present and is initialized. This is a required call before any QuickTime Java classes can be used.
When the user closes the window the program will quit, first calling QTSession.close to terminate QuickTime. It is necessary for programs to call QTSession.close if they have previously called QTSession.open in order to shut down QuickTime properly.